﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Sharp.DataTransferObject;
using Sharp.Portal.Mvc;
using Sharp.Portal;
using Sharp.Portal.AdminLTE;
using Sharp.Portal.Mvc.Form;
using Sharp.Portal.Other;
using Sharp.Portal.Mvc.List;
using Sharp.Portal.Mvc.Models;

namespace Sharp.WebBooter.Areas.Platform.Models
{
    [ModuleCode("003001"), Title("员工管理"), ModuleItem(typeof(EmployeeModel))]
    [DataHandler(ModuleOP.Details, "浏览", 0)]
    [DataHandler(ModuleOP.Create, "新增", 1)]
    [DataHandler(ModuleOP.Edit, "修改", 2)]
    [DataHandler(ModuleOP.Delete, "删除", 3)]
    [DataHandler(ModuleOP.Refresh, "刷新", 4)]
    [DataHandler("AsUser", "设为登录用户", 5, OnClientClick = "new Employee().ShowWindow();", Icon = "fa fa-user")]
    public partial class EmployeeIndexModel : BSSharpList
    {
        public EmployeeIndexModel()
        {
            this.Feature = ListFeature.MultiSelect | ListFeature.Paging | ListFeature.RowNumber;
            this.IsUseOrgTreeLayout = true;
            this.ImportJavascript = "~/Areas/Platform/Scripts/Employee.js";
            this.Breadcrumb = "<ol class=\"breadcrumb\"> <li><a href =\"@Url.Action(\"Index\", \"Home\")\"><i class=\"fa fa-home\"></i> 首页</a></li> <li class=\"active\">组织结构</li> </ol>";
        }
        /// <summary>
        /// 自定义查询面板
        /// </summary>
        protected override void InitQueryPanel()
        {
            base.InitQueryPanel();
            this.QueryItems.Add(new QueryItem()
            {
                Name = "OrgId",
                SearchFor = "OrgId",
                IsHiddenField = true,
                ValueFrom = QueryItem.ValueFromType.DefaultValue
            });
        }
        [Column(Hidden = true)]
        public System.Guid Id { get; set; }
        /// <summary>
        /// 工号
        /// </summary>
        [Column(Width = 100, Text = "工号", Locked = true)]
        public string Code { get; set; }

        /// <summary>
        /// 全名
        /// </summary>
        [Column(Width = 140, Text = "全名", Locked = true), QueryOption(Option = QueryFeature.DefualtQuery)]
        public string FullName { get; set; }
        /// <summary>
        /// 姓名简拼
        /// </summary>
        [Column(Width = 100, Text = "简拼", Hidden = true)]
        public string Jianpin { get; set; }
        /// <summary>
        /// 性别
        /// </summary>
        [Column(Width = 100, Text = "性别", Sortable = true), MasterData("Gender")]
        public string GenderCode { get; set; }
        /// <summary>
        /// 年龄
        /// </summary>
        [NumberColumn(Width = 100, Text = "年龄", Align = Alignment.Right, Format = "0"), QueryOption(Option = QueryFeature.None)]
        public int? Age { get; set; }
        /// <summary>
        /// 民族
        /// </summary>
        [Column(Width = 100, Text = "民族", Sortable = true, Align = Alignment.Center), MasterData("Nation")]
        public string NationCode { get; set; }
        /// <summary>
        /// 身份证
        /// </summary>
        [Column(Width = 200, Text = "身份证", Align = Alignment.Center)]
        public string IdCard { get; set; }
        /// <summary>
        /// 出生年月
        /// </summary>
        [Column(Width = 100, Text = "出生年月", Align = Alignment.Center)]
        public string Birthday { get; set; }
        /// <summary>
        /// 手机
        /// </summary>
        [Column(Width = 150, Text = "手机", Align = Alignment.Center)]
        public string Phone { get; set; }

        /// <summary>
        /// 职称
        /// </summary>
        [Column(Width = 150, Text = "职称", Align = Alignment.Center), MasterData("Posttitle")]
        public string PosttitleCode { get; set; }

        /// <summary>
        /// 职务
        /// </summary>
        [Column(Width = 150, Text = "职务")]
        public string JobTitle { get; set; }
        /// <summary>
        /// 传真
        /// </summary>
        [Column(Width = 100, Text = "传真")]
        public string Fax { get; set; }
        /// <summary>
        /// 电子邮件
        /// </summary>
        [Column(Width = 200, Text = "电子邮件")]
        public string Email { get; set; }
        /// <summary>
        /// 家庭地址
        /// </summary>
        [Column(Width = 260, Text = "家庭地址")]
        public string Address { get; set; }


        /// <summary>
        /// 户籍
        /// </summary>
        [Column(Width = 100, Text = "户籍")]
        public string RegisteredResidence { get; set; }
        /// <summary>
        /// 参加工作
        /// </summary>
        [Column(Width = 100, Text = "参加工作", Align = Alignment.Center)]
        public string WorkDate { get; set; }
        /// <summary>
        /// 婚姻状况
        /// </summary>
        [Column(Width = 100, Text = "婚姻状况", Align = Alignment.Center), MasterData("Married")]
        public string MarriedCode { get; set; }
        /// <summary>
        /// 学历
        /// </summary>
        [Column(Width = 100, Text = "学历", Sortable = true, Align = Alignment.Center), MasterData("EducationalBackground", true)]
        public string EducationalBackgroundCode { get; set; }
        /// <summary>
        /// 学位
        /// </summary>
        [Column(Width = 100, Text = "学位", Sortable = true, Align = Alignment.Center), MasterData("Degree")]
        public string DegreeCode { get; set; }
        /// <summary>
        /// 紧急联系人
        /// </summary>
        [Column(Width = 120, Text = "紧急联系人")]
        public string UrgentContact { get; set; }
        /// <summary>
        /// 紧急联系电话
        /// </summary>
        [Column(Width = 150, Text = "紧急联系电话")]
        public string UrgentPhone { get; set; }
        /// <summary>
        /// 任职状况
        /// </summary>
        [Column(Width = 100, Text = "任职状况", Sortable = true, Align = Alignment.Center), MasterData("PostState")]
        public string PostStateCode { get; set; }

    }

}
